package com.cellulam.framework.core.log.enums;


import com.cellulam.framework.core.enums.CodeDescriptionFeature;
import com.cellulam.framework.core.utils.EnumHelper;
import lombok.Getter;

/**
 * 日志等级
 */
@Getter
public enum LogLevel implements CodeDescriptionFeature{

    /**
     * debug
     */
    DEBUG(0, "debug"),
    /**
     * info
     */
    INFO(1, "info"),
    /**
     * warn
     */
    WARN(2, "warn"),
    /**
     * error
     */
    ERROR(3, "error");

    private final int code;
    private final String description;

    LogLevel(int code, String description){
        this.code = code;
        this.description = description;
    }

    public static LogLevel valueOf(int code){
        return EnumHelper.valueOf(code, LogLevel.class);
    }
}
